import requests from "./request";
import mockRequests from './mockAjax'

//商城产品信息
export const reqCategoryList=()=>{
    return requests({url:'/product/getBaseCategoryList',method:'get'});
}

//轮播图信息
export const reqGetBannerList=()=>mockRequests.get('/banner');

//楼层信息
export const reqFloorList=()=>mockRequests.get('/floor');

//搜索信息
export const reqGetSearchInfo=(params)=>requests({url:"/list",method:"post",data:params})

//获取商品详情信息
export const reqGoodsInfo=(skuId)=>requests({
    url:`/item/${skuId}`,
    method:'get'
})

//添加添加购物车信息
export const reqAddOrUpdateShopCart=(skuId,skuNum)=>requests({
    url:`/cart/addToCart/${skuId}/${skuNum}`,method:'post'
})

//获取购物车列表信息
export const reqCartList=()=>requests({url:'/cart/cartList',method:'get'});

//删除购物车信息
export const reqDeleteCartById=(skuId)=>requests({url:`/cart/deleteCart/${skuId}`,method:'delete'});

//获取验证码信息
export const reqGetCode=(phone)=>requests({url:`/user/passport/sendCode/${phone}`,method:'get'})

//注册
export const reqRegister=(data)=>requests({url:'/user/passport/register',data,method:'post'})

//登录
export const reqUserLogin=(data)=>requests({url:'/user/passport/login',data,method:'post'})